<form id="form" action="{:url('card/add')}">
<div class="titlebar"><i class="iconfont icon-iconset0280"></i>奖励政策 <span class="fn-f12 gray">针对开通会员的推荐人奖励</span></div>  
<table class="formtable"> 
    <tr><th>直推￥:</th><td><input class="input" datatype="npot" type="text" name="relation_l1" value="" /></td></tr>
    <tr><th>间推￥:</th><td><input class="input" datatype="npot" type="text" name="relation_l2" value="" /></td></tr>
</table>
<div class="titlebar"><i class="iconfont icon-edit"></i>优惠券信息</div>  
<table class="formtable"> 
    <th>所属好店:</th>
    <td>
        <input readonly="readonly" id="store_id" class="readonly input w100" type="text" name="store_id" value="" />
        <button url="{:url('allwin/card/selectStore',['input' => 'store_id'])}" type="button" class="selectid button"><i class="iconfont icon-my_icon"></i>选择用户</button>
        <button url="" type="button" class="reviewStore button button-blue"><i class="iconfont icon-search_icon"></i>预览</button>
    </td>
    </tr>
    <tr>
    <th>绑定优惠券:</th>
        <td>
            <input datatype="n" readonly="readonly" id="coupon_id" class="readonly input w100" type="text" name="coupon_id" />
            <button url="{:url('allwin/card/selectConpon',['input' => 'coupon_id'])}" type="button" class="selectConpon button"><i class="iconfont icon-discount"></i>绑定优惠券</button>
        </td>
    </tr>
    <tr><th>付款金额(元):</th><td><input class="input w100" datatype="npot" type="text" name="price" value="" /></td></tr>
    <tr><th>优惠券数量:</th><td><input class="input w100" datatype="n" type="text" name="coupon_num" value="" /></td></tr>
    <tr><th>活动名称:</th><td><input class="input" datatype="*" type="text" name="name" /></td></tr>
    <tr><th>使用须知:</th><td><div class="w600"><textarea class="input w300 ui-mieditor" datatype="*" type="text" name="tips" /></textarea></div></td></tr>
    <tr><th></th><td><input type="submit" value="确定" class="button button-blue submit" /><input type="reset" value="重置" class="button button-blank"/></td></tr>
</table>
</form>
<script type="text/javascript">
Do('base','layer','form','editor', function () {
    $('#form').isForm({'upload':'{:url("system/passport.common/upload")}'});
    $(".selectid").win();
    $(".reviewStore").click(function(){
        var id = $("#store_id").val();
        if(id==null || id=="" || id=='undefined'){
            parent.layer.alert('没有选择所属好店')
        }else{
            $(this).popup({'url':'{:url("allwin/store/review")}?id='+id})
        }
    });
    $(".selectConpon").click(function(){
        var id = $("#store_id").val();
        if(id==null || id=="" || id=='undefined'){
            parent.layer.alert('没有选择所属好店')
        }else{
            $(this).popup({'url':'{:url("allwin/card/selectConpon")}?input=coupon_id&store_id='+id});
        }
    });
})
</script>